import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class PointGet extends JFrame{
	JPanel pan = new JPanel();
	JLabel lab = new JLabel();
	JLabel namelab = new JLabel("ID");
	public PointGet() {
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setSize(300,300);
		
		pan.setLayout(null);
		add(pan,BorderLayout.CENTER);
		add(lab,BorderLayout.SOUTH);
		pan.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				int x = e.getX();
				int y = e.getY();
				String tmp = "("+x+","+y+")";
				lab.setText(tmp);
			}
		});
		
	}
	public static void main(String[] args) {
		new PointGet();
	}

}
